<template>
  <div>
    <van-tabbar v-model="active" @change="onchange" active-color="#ee0a24" inactive-color="#000">
      <van-tabbar-item to="/" name="home" icon="music-o">发现</van-tabbar-item>
      <van-tabbar-item to="/boke" name="boke" icon="bulb-o">播客</van-tabbar-item>
      <van-tabbar-item to="/mine" name="mine" icon="service-o">我的</van-tabbar-item>
      <van-tabbar-item to="/guan" name="guan" icon="friends-o">关注</van-tabbar-item>
      <van-tabbar-item to="/yun" name="yun" icon="aim">云存</van-tabbar-item>
    </van-tabbar>
  </div>
</template>
<script>
export default {
  name: "Tabbars",
  data() {
    return {
      active:'home'
    };
  },
  components: {},
  methods: {
    onchange(ind){ // ind 是name
      console.log(11,ind)
    }
  },
  created() {
    this.active = this.$route.name
    // if(this.$route.name === 'home') return this.active = 'home'
    // if(this.$route.name === 'boke') return this.active ='boke'
    // if(this.$route.name === 'mine') return this.active ='mine'
    // if(this.$route.name === 'guan') return this.active ='guan'
    // if(this.$route.name === 'yun') return this.active ='yun'
  },
  mounted() {
    console.log(this);
  },
};
</script>
<style lang="less">
</style>